home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / pdcurs21 / portable / touchwin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-18  |  1.6 KB  |  64 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    touchwin
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_touchwin = "$Header: C:\CURSES\portable\RCS\touchwin.c 2.1 1993/06/18 20:21:21 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   touchwin()    - touch window
  15.  
  16.   X/Open Description:
  17.      Throw away all optimisation information about which parts of the
  18.      window have been touched, by pretending that the entire window has
  19.      been drawn on.  This is sometimes necessary when using overlapping
  20.      windows, since a change to one window will affect the other window,
  21.      but the records of which lines have been changed in the other
  22.      window will not reflect the change.
  23.  
  24.   PDCurses Description:
  25.      No additional functionality in the PDCurses library.
  26.  
  27.   X/Open Return Value:
  28.      The touchwin() function returns OK on success and ERR on error.
  29.  
  30.   PDCurses Errors:
  31.      It is an error to pass a NULL window.
  32.  
  33.   Portability:
  34.      PDCurses    int touchwin( WINDOW* win );
  35.      SysV Curses    int touchwin( WINDOW* win );
  36.      BSD Curses    int touchwin( WINDOW* win );
  37.      X/Open Dec '88    int touchwin( WINDOW* win );
  38.  
  39. **man-end**********************************************************************/
  40.  
  41. int    touchwin(WINDOW *win)
  42. {
  43.     int    y;
  44.     int    maxy;
  45.     int    maxx;
  46.  
  47. #ifdef PDCDEBUG
  48.     if (trace_on) PDC_debug("touchwin() - called\n");
  49. #endif
  50.  
  51.     if (win == (WINDOW *)NULL)
  52.         return( ERR );
  53.  
  54.     maxy = win->_maxy - 1;
  55.     maxx = win->_maxx - 1;
  56.  
  57.     for (y = 0; y <= maxy; y++)
  58.     {
  59.         win->_firstch[y] = 0;
  60.         win->_lastch[y] = maxx;
  61.     }
  62.     return( OK );
  63. }
  64.